<!-- 列表 + 行操作-详情（前端固定） 
 筛选项：去掉新增按钮，前端添加固定日期区间-->
<template>
  <!-- 搜索框 -->
  <MyFilter :partParams="basicParams" @get-data="getData" @get-table-data="getTableData" />
  <!-- 列表 -->
  <MyTable ref="table" :partParams="tableParams" :tableInfo="tableInfo" />
</template>

<script lang="ts" setup>
import MyFilter from './component/MyFilter.vue'
import MyTable from './component/MyTable.vue'
import { computed, defineProps, ref } from 'vue'

//定义接收的props
const props = defineProps({
  // 定义一个对象类型的 prop
  data: {
    type: Object,
    default: () => ({ groupName: '', jobType: '' })
  }
})

const basicParams = computed(() => {
  return {
    groupName: props.data.groupName,
    jobType: props.data.jobType,
    operType: 'GetList'
  }
})

const tableParams = ref()

const table = ref()
/** 查询列表 */
const getData = async (query: any) => {
  tableParams.value = JSON.parse(JSON.stringify(query))
}

const tableInfo = ref([])
// 获取表格信息
const getTableData = (data: any) => {
  tableInfo.value = data
}
</script>
